<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <%--静态包含base标签，css，jQuery文件，--%>
    <%@include file="/view/common/head.jsp"%>
    <Script type="text/javascript">
        $(function () {
            // 给加入入库列表按钮绑定单击事件
            $("button.addToList").click(function () {
                // alert("添加成功");
                var clothesId = $(this).attr("clothesId");
                location.href = "${basePath}listServlet?action=addItem&status=1&id=" + clothesId;
            });
        });
    </Script>
</head>
<body>

<div id="header">
    <%@include file="/view/common/back.jsp"%>
    <span class="wel_word">服装批发网</span>
    <div>
    <c:if test="${not empty sessionScope.admin}">
        <span>欢迎<span class="um_span">${sessionScope.admin.adminname}</span>光临服装批发网</span>
<%--        <a href="view/order/order.jsp">我的订单</a>--%>

    </c:if>
        <a href="view/list/goods_list.jsp">入库列表</a>&nbsp;&nbsp;
        <a href="adminServlet?action=logout">注销</a>&nbsp;&nbsp;

        <a href="manage/clothesServlet?action=getClotheslist">后台管理</a>
    </div>
</div>
<div id="main">
    <div id="clothes">
        <div style="text-align: center;height:58px;">
            <c:if test="${empty sessionScope.go_list.items}">
<%--                如果入库列表为空--%>
                <span style="display: inline-block; height: 21.6px; width:185px;"></span>

                <div>
                    <span> </span>
                    <span style="color: red">入库列表为空</span>
                </div>
            </c:if>
            <c:if test="${ not empty sessionScope.go_list.items}">
                <%--                如果入库列表不为空--%>
                <span>您的入库列表中有${sessionScope.go_list.totalCount}件商品</span>
                <div>
                    您刚刚将<span style="color: red">${sessionScope.go_lastname}</span>加入到了入库列表中
                </div>
            </c:if>

        </div>
        <c:forEach items="${requestScope.page.items}" var="clothes">

        <div class="b_list">
            <div class="img_div">
                <img class="clothes_img" alt="" src="${clothes.imgPath}" />
            </div>
            <div class="clothes_info">
                <div class="clothes_name">
                    <span class="sp1">衣服:</span>
                    <span class="sp2">${clothes.name}</span>
                </div>
                <div class="clothes_kind">
                    <span class="sp1">类别:</span>
                    <span class="sp2">${clothes.kind}</span>
                </div>
                <div class="clothes_price">
                    <span class="sp1">价格:</span>
                    <span class="sp2">￥${clothes.price}</span>
                </div>
                <div class="clothes_sales">
                    <span class="sp1">销量:</span>
                    <span class="sp2">${clothes.sales}</span>
                </div>
                <div class="clothes_add">
                    <button clothesId="${clothes.id}" class="addToList">入库</button>
                </div>
            </div>
        </div>
        </c:forEach>

    </div>

</div>

<%@include file="/view/common/page_nav.jsp"%>
<%@include file="/view/common/footer.jsp"%>
</body>
</html>
